import React from 'react';

export default function funForm(Comp) {
    return class WrapperComp extends React.Component {
        constructor(props) {
            super(props);
            this.handleChange = this.handleChange.bind(this);
            this.state = {};
        }
        handleChange(key, val) {
            this.setState({
                [key]: val
            })
        }
        render (){
            return <Comp {...this.props} handleChange={this.handleChange} state={this.state} />
        }
    }

}